// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[5147.5469,7979.6294,0]]; // index: 49,   Officer near Benoma
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "The enemy has a small outpost in the forest. Arrest the officer there and bring him back to the flag at your base to get some vital intel.";
	d_current_mission_resolved_text = "Good job. The officer was arrested.  Soon their vodka stash will be ours.";
};

if (isServer) then {
	_officer = switch (d_enemy_side) do {
		case "EAST": {"Ins_Commander"};
		case "WEST": {"CDF_Commander"};
		case "GUER": {"GUE_Commander"};
	};
	__Poss
	sleep 2.111;
	__GetEGrp(_ogroup)
	_sm_vehicle = _ogroup createUnit [_officer, _poss, [], 0, "FORM"];
	[_sm_vehicle] join _ogroup;
	allunits_add set [count allunits_add, _sm_vehicle];
	_sm_vehicle addEventHandler ["killed", {_this call XKilledSMTarget500}];
	removeAllWeapons _sm_vehicle;
	sleep 2.123;
	sleep 2.123;
	["specops", 3, "basic", 2, _poss, 100,true] spawn XCreateInf;
	sleep 2.123;
	["uaz_mg", 1, "bmp", 0, "tank", 0, _poss,1,120,true] spawn XCreateArmor;
	sleep 2.123;
	_leadero = leader _ogroup;
	_leadero setRank "COLONEL";
	_ogroup allowFleeing 0;
	_ogroup setbehaviour "AWARE";
	[_sm_vehicle] execVM "x_missions\common\x_sidearrest.sqf";
};

if (true) exitWith {};